package com.creative.constant;


import java.util.Locale;

/**
 * 通用常量信息
 *
 * @author ruoyi
 */
public class Constants {
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * 系统语言
     */
    public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;

    /**
     * www主域
     */
    public static final String WWW = "www.";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";


    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 1;

    /**
     * 令牌
     */
    public static final String TOKEN_INFO = "token:info";


    public static final String USER_CAPTCHA = "captcha:user:";
    //  用户验证码
    public static final String USER_CODE = "user:code:";

    /**
     * 电子邮件验证码
     */
    public static final String EMAIL_CODE = "eamil:code:";
    /**
     * 登录令牌
     */
    public static final String LOGIN_TOKEN = "satoken:login:token:";

    /**
     * 登录会话
     */
    public static final String LOGIN_SESSION = "satoken:login:session:";
    /**
     * 登录用户有限期      2h
     */
    public static final Long LOGIN_USER_TTL = 7200L;

    /**
     * 临时令牌密钥
     */
    public static final String Temp_token_key = "satoken:login:token-session:";
    public static final String SESSION_KEY = "session_key";
    //    qq回调的返回值
    public static final String VIEW_OBJ_RESULT_KEY = "result";

    /**
     * 验证码uuid
     */
    private static final String CAPTCHA_UUID = "captcha:uuid:";


    /**
     * redis密钥-用户已使用的空间
     */
    public static final String REDIS_KEY_USER_SPACE_USE = "spaceuse:";


    /**
     * 文件保存路径
     */
    public static final String FILE_SAVE_PATH = "/file/";

    /**
     * 头像的文件保存目录
     */
    public static final String FILE_FOLDER_AVATAR_NAME = "avatar/";

    /**
     * 文件夹头像名称后缀
     */
    public static final String FILE_FOLDER_AVATAR_NAME_SUFFIX = ".png";

    //    默认头像
    public static final String AVATAR_DEFAULT = "default_avatar";

    //    图片
    public static final String[] IMAGE_SUFFIX = new String[]{"jpg", "jpeg", "png", "gif", "webp", "svg"};
    //    视频
    public static final String[] VIDEO_SUFFIX = new String[]{"mp4", "avi", "wmv", "mov", "flv", "mkv"};
    //    音频
    public static final String[] AUDIO_SUFFIX = new String[]{"mp3", "wav", "ogg", "flac"};

    //   redis  每日随机素材
    public static final String RANDOM_MATERIAL_KEY = "random:material:";
    //    首页数据的缓存时间 (一天) 24h
    public static final Long COMMON_PAGE_DATA_TTL = 24L;
    //    查询数据库和redis为空的缓存时间 缓存 ""  5分钟
    public static final Long CACHE_NULL_TTL = 5L;

    //    redis中轮播图的缓存
    public static final String CACHE_BANNER_KEY = "cache:banner";
    //    redis中公告栏的缓存
    public static final String CACHE_NOTICE_KEY = "cache:notice";
    //    redis中主题的缓存
    public static final String CACHE_THEMATIC_SELECTION_KEY = "cache:thematicSelection";

    //    redis中每日推荐的图片素材的缓存   index 0 图片  1 视频  2 音频
    public static final String CACHE_RANDOM_MATERIAL_IMAGE_KEY = "cache:randomMaterial:image";
    //    redis中每日推荐的视频素材的缓存
    public static final String CACHE_RANDOM_MATERIAL_VIDEO_KEY = "cache:randomMaterial:video";
    //    redis中每日推荐的音频素材的缓存
    public static final String CACHE_RANDOM_MATERIAL_AUDIO_KEY = "cache:randomMaterial:audio";
    //    redis中分类的缓存
    public static final String CACHE_MATERIAL_TYPE_KEY = "cache:materialType";
//    redis中access_token的缓存
    public static final String CACHE_ACCESS_TOKEN_KEY = "cache:accessToken";

}
